home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / G DATA AddOns2 / WebShop / _SETUP.1 / sb2buy2.js < prev    next >
Text File  |  2002-01-07  |  8KB  |  150 lines

  1. <!-- sb2buy2 Order page functions         -->
  2. <!-- (c) Copyright 2001 GS Software       -->
  3. <!--                                      -->
  4. <SCRIPT LANGUAGE="JavaScript">
  5.  
  6.  
  7. function showItems()
  8. {
  9.         var tablerowcolor = '#F0F0F0';
  10.  
  11.         totprice = 0;
  12.         totvat = 0;
  13.         document.writeln('<TABLE class="basket" width=100% BORDER=0 CELLPADDING="2">');
  14.         document.writeln('<TR BGCOLOR="#C0C0C0"><TD class="basket"><b>'+parent.Loc_Article+'</b></TD><TD class="basket" align="right"><b>'+parent.Loc_Quantity+'</b></TD><TD class="basket" align="right"><b>'+parent.Loc_PriceEach+'</b></TD><td class="basket" align="right"><b>'+parent.Loc_PriceTotal+'</b></td></TR>');
  15.         document.writeln('<TR BGCOLOR="F8F8F8"><TD class="basket" colspan="4"><HR></TD></TR>');
  16.  
  17.         for (var i = 1; i < parent.theBasket.length; i++)
  18.         {
  19.                 with(parent.theBasket[i])
  20.                 {
  21.                         theitem=Item;
  22.                         thequantity =Quantity;
  23.                         itemtotal = 0;
  24.  
  25.                         if ((parseFloat(Price2)>0) && (parseInt(Quantity) >= parseInt(Quantity2)))
  26.                                 theprice=Price2
  27.                         else
  28.                                 if ((parseFloat(Price1)>0) && (parseInt(Quantity) >= parseInt(Quantity1)))
  29.                                         theprice=Price1
  30.                                 else
  31.                                         theprice = Price;
  32.  
  33.                         itemtotal = (eval(theprice*thequantity));
  34.                         temptotal = itemtotal * 100;
  35.                         totprice = totprice + itemtotal;
  36.  
  37.                         thisvat = (parseFloat(itemtotal*productvatrate)) / (parseFloat(productvatrate)+parseFloat(100));
  38.                         thisvat = parseFloat(parent.alterError(thisvat));
  39.                         totvat = totvat + thisvat;
  40.  
  41.                         if(Attribut1=='') A1=''; else A1=', '+Attribut1;
  42.                         if(Attribut2=='') A2=''; else A2=', '+Attribut2;
  43.                         if(Attribut3=='') A3=''; else A3=', '+Attribut3;
  44.  
  45.                         itemlist=i;
  46.  
  47.                         hilf="";
  48.                         if (Textin != "") hilf="<BR> "+Textin;
  49.                         document.write('<tr BGCOLOR="'+tablerowcolor+'"> <td class="basket">'+theitem+A1+A2+A3+hilf+'</td>');
  50.                         document.writeln('<td class="basket" align=right>'+thequantity+'</td><td class="basket" align=right>'+parent.alterError(theprice)+'</td><td class="basket" align=right>'+parent.alterError(itemtotal)+'</td></tr>');
  51.                         document.writeln('<INPUT TYPE="hidden" NAME="Artikel'+itemlist+'" VALUE="'+theitem+A1+A2+A3+" "+Textin+'" SIZE="40">');
  52.                         document.writeln('<INPUT TYPE="hidden" NAME="Menge'+itemlist+'" VALUE="'+thequantity+'" SIZE="40">');
  53.                         document.writeln('<INPUT TYPE="hidden" NAME="Einzelpreis'+itemlist+'" VALUE="'+theprice+'" SIZE="40">');
  54.  
  55.                         {IfShowVat}
  56.                         document.writeln('<INPUT TYPE="hidden" NAME="'+parent.Loc_ShortVat+itemlist+'" VALUE="'+parent.alterError(thisvat)+' ('+productvatrate+'%)" SIZE="40">');
  57.                         {EndIfShowVat}
  58.  
  59.                         {ifshowvat}+' inkl. '+productvatrate+'% MwSt'{endifshowvat}
  60.                         document.writeln('<INPUT TYPE="hidden" NAME="Gesamtpreis'+itemlist+'" VALUE="'+parent.alterError(itemtotal)+'" SIZE="40">');
  61.  
  62.                         if (tablerowcolor == '#F0F0F0')
  63.                                 tablerowcolor = "#F8F8F8";
  64.                         else
  65.                                 tablerowcolor = "#F0F0F0";
  66.                 }
  67.         }
  68.  
  69.  
  70.         var postage=0;
  71.         postage=parseFloat(parent.myshipmentvalue);
  72.         var discount=0;
  73.  
  74.         if ((totprice>={DisAmount1})&({DisCount1} != 0))
  75.                 discount={Discount1};
  76.  
  77.         if((totprice>={DisAmount2})&({DisCount2}!=0))
  78.                 discount={Discount2};
  79.  
  80.         var discountamount=totprice*discount/100;
  81.         var discountprice=totprice-discountamount;
  82.  
  83.         if ((discountprice>={PAmount1})&({PAmount1}!=0)&(postage>{Postage1}))
  84.                 postage={Postage1};
  85.  
  86.         if ((discountprice>={PAmount2})&({PAmount2}!=0)&(postage>{Postage2}))
  87.                 postage={Postage2};
  88.  
  89.         document.writeln('<TR BGCOLOR="F8F8F8"><TD class="basket" colspan="4"><HR></TD></TR>');
  90.         document.writeln('<INPUT TYPE="hidden" NAME="pid" VALUE="'+parent.pid+'">');
  91.         var finalprice=discountprice+postage;
  92.  
  93.         document.writeln('<TR BGCOLOR="#C0C0C0"><td class="basket" colspan=3><b>'+parent.Loc_Total+'</b></td><td class="basket" align=right><b>{Currency} '+parent.alterError(totprice)+'</b></td></tr>');
  94.  
  95.         {IfUseCurrency1}
  96.         document.writeln('<TR BGCOLOR="#C0C0C0"><td class="basket" colspan=3>'+parent.Loc_InEuro+' {Currency1} '+parent.alterError(totprice*{CURRENCYCONVERTER1})+'</td><td class="basket" align=right></td></tr>');
  97.         {ElseIfUseCurrency1}
  98.         {EndIfUseCurrency1}
  99.  
  100.         if (discount>0)
  101.                 document.writeln('<TR BGCOLOR="#C0C0C0"><td class="basket"><b>'+parent.Loc_Discount+'</b></td><td class="basket" align=right colspan=2><b>'+parent.alterError(discount)+" %"+'</b></td><td class="basket" align=right><b>{Currency} '+parent.alterError(discountamount)+'</b></td></tr>');
  102.  
  103.         document.writeln('<TR BGCOLOR="#C0C0C0"><td class="basket" colspan=3><b>'+parent.Loc_Postage+ '</b> ('+parent.myshipmenttext+')</td><td class="basket" align=right><b>{Currency} '+parent.alterError(postage)+'</b></td></tr>');
  104.  
  105.         document.writeln('<TR BGCOLOR="#C0C0C0"><TD class="basket" colspan="5"></TD></TR>');
  106.  
  107.         document.writeln('<TR BGCOLOR="#C0C0C0"><td class="basket" colspan=3><b>Endpreis</b> (Zahlung per '+parent.mypaymentvalue+')</td><td class="basket" align=right><b>{Currency} '+parent.alterError(finalprice)+'</b></td></tr>');
  108.  
  109.         {IFSHOWVAT}
  110.         var postagevat = postage*{VATRATE}/({VATRATE}+100)
  111.         totvat = totvat + postagevat;        
  112.         document.writeln('<tr BGCOLOR="#C0C0C0"><td class="basket" colspan=3>'+parent.Loc_VAT+': {Currency} '+parent.alterError(totvat)+'</td><td class="basket" align=right></td></tr>');
  113.         {ENDIFSHOWVAT}
  114.  
  115.  
  116.  
  117.         document.writeln('<INPUT TYPE="hidden" NAME="Warenwert" VALUE="'+parent.alterError(totprice)+'" SIZE="40">');
  118.  
  119.         if (discount>0)
  120.         document.writeln('<INPUT TYPE="hidden" NAME="Rabatt" VALUE="'+parent.alterError(discountamount)+'" SIZE="40">');
  121.  
  122.         document.writeln('<INPUT TYPE="hidden" NAME="Versandart" VALUE="'+parent.myshipmenttext+'" SIZE="40">');
  123.  
  124.         document.writeln('<INPUT TYPE="hidden" NAME="Versandkosten" VALUE="'+parent.alterError(postage)+'" SIZE="40">');
  125.  
  126.         document.writeln('<INPUT TYPE="hidden" NAME="Zahlungsart" VALUE="'+parent.mypaymentvalue+'" SIZE="40">');
  127.  
  128.         {IFSHOWVAT}
  129.         document.writeln('<INPUT TYPE="hidden" NAME="'+parent.Loc_VAT+'" VALUE="'+parent.alterError(totvat)+'" SIZE="40">');
  130.         {ENDIFSHOWVAT}
  131.  
  132.         <!--{IfPaybox}-->        
  133.         if (parent.mypaymentvalue == 'Paybox') 
  134.         { 
  135.           document.writeln('<INPUT TYPE="hidden" NAME="PayboxOrderNr" VALUE="'+parent.mypayboxnr+'" SIZE="40">');
  136.         }
  137.         <!--{EndIfPaybox}-->        
  138.  
  139.  
  140.  
  141.  
  142.         document.writeln('<INPUT TYPE="hidden" NAME="Rechnungsbetrag" VALUE="'+parent.alterError(finalprice)+'" SIZE="40">');
  143.  
  144.  
  145.  
  146.         document.writeln('</TABLE>');
  147. }
  148.  
  149. </SCRIPT>
  150.